<?php /*a:1:{s:57:"/www/Data/Cloud/application/mobile/view/Index/bindwx.html";i:1638262425;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>绑定手机号码</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="/yao/css/style.css" rel="stylesheet" type="text/css"/>
    </head>
    <style>
     .shuru{
            width: 90%;
            line-height: 30px;
            margin-left: 5%;
           border-radius: 5px;
        }
    </style>
    <body>

        <section class="aui-flexView">
            <header class="aui-navBar aui-navBar-fixed">
                <a href="javascript:history.go(-1)" class="aui-navBar-item">
                    <i class="icon icon-return"></i>
                </a>
                <div class="aui-center">
                    <span class="aui-center-title">绑定你的代理商手机号码</span>
                </div>

            </header>
            <section class="aui-scrollView">
                

                <div class="aui-flex">
                    <div class="aui-flex-box">
                        <h6>我的邀请战绩</h6>
                    </div>
                </div>
                <div class="aui-palace">
                     
                    <input type="number" value="" class="shuru" id="phone" placeholder="绑定手机号码">
                    <input type="hidden" value="<?php echo htmlentities($openid); ?>" id="openid">
                </div>
                </div>
                <div class="aui-button-btn">
                  <button id="bindphone">绑定手机号码</button>
                </div>
              </div>
               
         
              
            </section>
        </section>
        <style>
        .shuru{
            width: 90%;
            line-height: 30px;
            margin-left: 5%;
           border-radius: 5px;
        }
        .aui-button-btn button{
             border-radius: 5px;
        }
        .node{
            margin-left: 5%;
            padding-bottom: 10px;
            font-size: 12px;
        }
        	.tooltiptext {
    width: 50%;
    line-height: 30px;
    background-color: #A9A9A9;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    margin-left: 20%;
    top: 60%;
    font-size: 14px;

}
.tooltip{text-align: center}
        </style>
        <uni-view class="tooltip">
                        <div class="tooltiptext" style="display: none"></div>
                    </uni-view>
        <script src='/static/js/jquery.min.js'></script>
       <script type="text/javascript">
            function closewin(){
                console.log(11);
                AndroidJs.close();
            }
             function fun() {
                clearInterval(inter);
                $(".tooltiptext").hide();
                $(".tooltiptext").text("")
            }
            $("#bindphone").click(function(){
                var openid = $("#openid").val();
                if(!openid){
                    $(".tooltiptext").text("用户获取失败")
                    $(".tooltiptext").show();
                    inter = setInterval("fun()", 2000);
                    return;
                }
                var phone = $("#phone").val();
                 if(!phone){
                    $(".tooltiptext").text("手机不能为空")
                    $(".tooltiptext").show();
                    inter = setInterval("fun()", 2000);
                    return;
                }
               
                $.post('/mobile/Index/postbindwx', {
                    phone:phone,
                    openid:openid
                }, function (res) {
                   if(res.code == '1'){
                   
                       window.location.href = "/mobile/Index/login?phone="+phone+"&openid="+openid;
                   }else{
                       $(".tooltiptext").text(res.msg)
                        $(".tooltiptext").show();
                        inter = setInterval("fun()", 2000);
                   }
                }, 'json');
            })    
        </script>
    </body>
</html>

